﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>slot最原始用法</title>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script src="../js/jquery-2.2.0.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
</head>
<body>
<h1>slot最原始用法</h1><br/>

<div id="app">
    {{name}}<br/>
    <modal>
        <h3>传入的所有内容都会当作插入到slot里</h3>
        <h3>这是一个默认内容，传入就会把这里的所有内容全替换到slot里</h3>
        <div>this is my slot</div>
    </modal>
</div>

<template id="modal">
    <div>
        <slot></slot>
    </div>
</template>
<script src="../js/vue-2.5.16.js"></script>
<script src="../node_modules/axios/dist/axios.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>

<script>
    let modal = {
        template:'#modal'
    };

    var app = new Vue({
        el:'#app',
        data:{
            name:'模版数据'
        },
        components:{
            modal
        }
    });
</script>

</body>
</html>